package com.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.demo.entity.TripOrder;
import com.demo.mapper.TripOrderMapper;
import com.demo.service.TripOrderService;
import org.springframework.stereotype.Service;

/**
 *
 *  出行预约service接口
 *
 */
@Service
public class TripOrderServiceImpl extends ServiceImpl<TripOrderMapper, TripOrder> implements TripOrderService {
    @Override
    public TripOrder getByUserId(Long userId) {
        LambdaQueryWrapper<TripOrder> queryWrapper = new LambdaQueryWrapper<TripOrder>();
        queryWrapper.eq(TripOrder::getUserId, userId);
        return baseMapper.selectOne(queryWrapper);
    }
}
